<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>编辑用户</title>
</head>
<body>
	<?php 
	/*if (isset($_GET['id']) && !empty($_GET['id'])) {
		# code...
	}*/
	require_once 'text03.php';
	if (!empty($_GET['id'])) {
		connectDB();
		$id=intval($_GET['id']);
		$result=mysql_query("SELECT * FROM users WHERE id=$id");
		if(mysql_errno()){
			die('can not connet db');
		}
		$arr=mysql_fetch_assoc($result);
	}else {
		die('id not define');
	}
 ?>
 <form action="edit_serve.php" method="post">
 	<div>
 		用户ID
 		<input type="text" name="id" value="<?php echo $arr['id'];?>"/>
 	</div>
 		<div>
 		用户名字
 		<input type="text" name="name" value="<?php echo $arr['name'];?>" />
 	</div>
 		<div>
 		用户年龄
 		<input type="text" name="age" value="<?php echo $arr['age'];?>"/>
 	</div>
 	<input type="submit" value="提交修改" />
 </form>
</body>
</html>
